Description:
Use a
case of statement instead of several nested if-else statements
testing the same expression.
You can set the option, Minimal number of cases, in the audit's properties to define the minimal size of the
if-else construct that RIEWS will suggest to convert to a
case of.
Incorrect:
if obj.getObjectKind() = TABLE then
...
else if obj.getObjectKind() = TREE then
...
else if obj.getObjectKind() = TAB_FOLDER then
...
else if obj.getObjectKind() = TOOL_BAR then
...
Correct:
case obj.getObjectKind() of
TABLE:
...
TREE:
...
TAB_FOLDER:
...
TOOL_BAR:
...
end;